package org.bao.pet.utils;

public class PlatformInfo {
	private static PlatformInfo instance = null;
	
	
	public static final String SEPARATOR_WINDOWS = "\\";
	public static final String SEPARATOR_LINUX = "/";
	
	public static final String INFO_TYPE_SEPARATOR = "SEPARATOR";
	public static final String INFO_TYPE_WORKSPACE = "WORKSPACE";
	public static final String INFO_TYPE_WATERMARK = "WATERMARK";
	
	private String separator = null;
	private String workspace = null;
	private String watermark = null;
	
	private PlatformInfo(){
	//empty
	}
	
	public static PlatformInfo getInstance(){
		if(instance == null){
			instance = new PlatformInfo();
		}
		
		return instance;
	}
	
	public void set(String id,String value){
		if(id == PlatformInfo.INFO_TYPE_SEPARATOR){
			this.separator = value;
		}
		else
		if(id == PlatformInfo.INFO_TYPE_WORKSPACE){
			this.workspace = value;
		}
		else
		if(id == PlatformInfo.INFO_TYPE_WATERMARK){
			this.watermark = value;
		}
	}
	
	public String get(String key){
		if(key == PlatformInfo.INFO_TYPE_SEPARATOR){
			return this.separator;
		}
		else
		if(key == PlatformInfo.INFO_TYPE_WORKSPACE){
			return this.workspace;
		}
		else
		if(key == PlatformInfo.INFO_TYPE_WATERMARK){
			return this.watermark;
		}
		
		return null;
	}
}
